home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / Akua Sweets 131 / Akua Sweets Examples / Resource / Save Uncompressed Copy < prev    next >
Encoding:
Text File  |  1999-03-04  |  913 b   |  45 lines  |  [TEXT/ToyS]

  1. on run
  2.     choose file with prompt "Choose an application" of type {"APPL"}
  3.     open {the result}
  4. end run
  5.  
  6.  
  7. on open fsObjs
  8.     repeat with fsObj in fsObjs
  9.         DoFile(fsObj)
  10.     end repeat
  11. end open
  12.  
  13.  
  14. on DoFile(fsObj)
  15.     set appName to the catalog name of (basic info for fsObj)
  16.     
  17.     tell application appName to (the number of resources in fsObj with their info)
  18.     set resList to the result
  19.     
  20.     -- {{rType, {{rNum, rName}, {rNum, rName}...}}, {rType, {...}}}
  21.     repeat with resType in resList
  22.         set rType to item 1 of resType
  23.         set rItems to item 2 of resType
  24.         
  25.         repeat with resItem in rItems
  26.             set rNum to item 1 of resItem
  27.             
  28.             tell application appName to (the resource in fsObj ¬
  29.                 of type rType ¬
  30.                 numbered rNum ¬
  31.                 with its info)
  32.             
  33.             set rData to the result
  34.             
  35.             save resource (item 3 of rData) ¬
  36.                 in dstFile ¬
  37.                 named (item 2 of rData) ¬
  38.                 numbered (item 1 of rData)
  39.         end repeat
  40.     end repeat
  41.     
  42. end DoFile
  43.  
  44.  
  45.